<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1, user-scalable=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="css/index.css">
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
    <style type="text/css">
    *{margin:0;padding:0;border:0;}
    html{height: 100%}
    body{
        width: 100%;height: 100%;background:url(images/b-bg_02.png) 0 0 no-repeat;
        -webkit-background-size: 100% 100%;
        background-size: 100% 100%;
    }
    .down button{
        height: 2.5rem;
        width: 45%;
        border-radius: 40px;
        background-color: #fc4f2f;
        color: #fff;
        font-size:1.4rem ;
        line-height: 2.5rem;
        text-align: center;
        position: absolute;
        left: 50%;
        top:40%;
        margin-left: -20%;
        outline: none
    }
    section{border:0 none;}
    .rods{display: none}
    div.rod{
        position: fixed;
        left: 0;
        top: 0;
        z-index: 9;
        height: 100%;width: 100%;background:  url(images/rod-bg.png) 0 0 no-repeat;
        -webkit-background-size: 100% auto;
        background-size: 100% auto;
    }
   .rods:after{
        content: "";
        position: fixed;
        top:0;
        left: 0;
        z-index: 1;
        height: 100%;
        width: 100%;
        background-color: rgba(0,0,0,0.7);
    }
    </style>
</head>
<body >
    <section class="down">
        <button onclick="goDownload()">立即下载</button>
    </section>
    <section class="rods">
        <div class="rod"></div>
    </section>
    <script>
        //goDownload();

        // 去下载
        function goDownload() {
            var u = navigator.userAgent, app = navigator.appVersion;
            var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1;
            var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
			
			// 是微信内部webView
            if (is_weixn()) {//alert(1);
            	$(".rods").show();
               //alert("微信下载"); // 跳应用宝下载地址
            }else if (isAndroid) {//alert(2);
               //alert("安卓下载");// 跳安卓端下载地址
			   $(".rods").hide();
            	window.location.href = 'http://app.91peini.com/pnservice/app/1.0.4_pn.apk';
            }else if (isIOS) {//alert(3);
				$(".rods").hide();
               //alert("IOS下载"); // 跳AppStore下载地址
            	window.location.href = 'https://itunes.apple.com/cn/app/%E9%99%AA%E4%BD%A0app-%E8%AE%A9%E6%88%91%E9%99%AA%E4%BC%B4%E4%BD%A0/id1182846962?mt=8'; 
            }
			
			
            // 这里是安卓浏览器
            
            // 这里是iOS浏览器
            

            

            // 是PC端
            if (IsPC()) {
                //alert("PC端");  // 公司主页
            	window.location.href = 'http://app.91peini.com/pnservice/app/1.0.4_pn.apk';
            }
        }

        // 是微信浏览器
        function is_weixn(){
            var ua = navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i)=="micromessenger") {
                return true;
            } else {
                return false;
            }
        }


        function IsPC() {
            var userAgentInfo = navigator.userAgent;
            var Agents = ["Android", "iPhone",
                "SymbianOS", "Windows Phone",
                "iPad", "iPod"];
            var flag = true;
            for (var v = 0; v < Agents.length; v++) {
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }

    </script>
</body>
</html>